package HomeWork.AdvancedStream;

import java.io.*;

/**
 * 用对象流读写对象
 */
public class Practice02 {
    public static void main(String[] args) throws IOException {
        int age=2;
        String name="Emily";
        String master="Kyle";
        String[] otherInfo={"Has three eyes","like an alien cat","super cool!"};
        Cat c=new Cat(age,name,master,otherInfo);
        System.out.println(c);
        FileOutputStream fos=new FileOutputStream("cat.obb");
        ObjectOutputStream oos=new ObjectOutputStream(fos);
        oos.writeObject(c);
        System.out.println("对象写出完毕！");
        oos.close();
    }
}
